package Demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:写博客测试代码
 * User: LianBao
 * Date: 2024-03-04
 * Time: 12:44
 */
//abstract interface ipp{}

//class Person {
//    private String name = "Person";
//    int age = 0;
//}

//class Animal {
//
//    public String name;//年龄
//    public int age;//年龄
//    public String color;//毛发
//
//    public void eat() {
//        System.out.println(this.name + "正在吃饭");
//    }
//
//    public void sleep() {
//        System.out.println(this.name + "正在睡觉");
//    }
//}
//
//class Dog extends Animal {
//    public void bark() {
//        System.out.println(this.name + "正在汪汪叫");
//    }
//}
//
//class Cat extends Animal {
//    public void meow() {
//        System.out.println(this.name + "正在喵喵叫");
//    }
//}


class A {
    public A() {
        System.out.println("父类构造方法");
    }

    {
        System.out.println("父类实例代码块");
    }

    static {
        System.out.println("父类静态代码块");
    }
//    public void f() {
//
//    }
//    public A(int a) {
//        this.f();
//    }
}

class B extends A {
    public B() {
        System.out.println("子类构造方法");
    }

    {
        System.out.println("子类实例代码块");
    }

    static {
        System.out.println("子类静态代码块");
    }

}

public class Child {
    public static void main(String[] args) {
        B b1 = new B();
        System.out.println("===========");
        B b2 =new B();
    }
}
